﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
/// <summary>
    /// ТАБЛИЦА «PORTF_BAL» - АГРЕГИРОВАННЫЙ БАЛАНС ПОЗИЦИЙ ПО ПОРТФЕЛЯМ
    /// Ключевое поле: acc_code
    /// </summary>
    class PortfBal : INotifyPropertyChanged
    {
        #region Private

        private string _accCode;
        private int _treaty;
        private double _forwardBal;
        private double _money;
        private double _deposit;
        private double _dailyPl;
        private double _relPl;
        private string _accName;


        #endregion

        #region Public

          /// <summary>
        /// Портфель.
        /// </summary>
        public string AccCode
        {
            get { return _accCode; }
            set
            {
                if (_accCode != value)
                    _accCode = value;

                RaisePropertyChanged("AccCode");
            }
        }
        /// <summary>
        /// Счет.
        /// </summary>
        public int Treaty
        {
            get { return _treaty; }
            set
            {
                if (_treaty != value)
                    _treaty = value;

                RaisePropertyChanged("Treaty");
            }
        }
        /// <summary>
        /// Баланс.
        /// </summary>
        public double ForwardBal
        {
            get { return _forwardBal; }
            set
            {
                if (_forwardBal != value)
                    _forwardBal = value;

                RaisePropertyChanged("ForwardBal");
            }
        }
        /// <summary>
        /// Деньги.
        /// </summary>
        public double Money
        {
            get { return _money; }
            set
            {
                if (_money != value)
                    _money = value;

                RaisePropertyChanged("Money");
            }
        }
        /// <summary>
        /// Гарантийное обеспечение срочного рынка.
        /// </summary>
        public double Deposit
        {
            get { return _deposit; }
            set
            {
                if (_deposit != value)
                    _deposit = value;

                RaisePropertyChanged("Deposit");
            }
        }
        /// <summary>
        /// Прибыль/убыток дня.
        /// </summary>
        public double DailyPl
        {
            get { return _dailyPl; }
            set
            {
                if (_dailyPl != value)
                    _dailyPl = value;

                RaisePropertyChanged("DailyPl");
            }
        }
        /// <summary>
        /// %Прибыль/убыток дня.
        /// </summary>
        public double RelPl
        {
            get { return _relPl; }
            set
            {
                if (_relPl != value)
                    _relPl = value;

                RaisePropertyChanged("RelPl");
            }
        }
        /// <summary>
        /// Название портфеля.
        /// </summary>
        public string AccName
        {
            get { return _accName; }
            set
            {
                if (_accName != value)
                    _accName = value;

                RaisePropertyChanged("AccName");
            }
        }


        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
